package cool.qingqing.test;

import cool.qingqing.Main;
import cool.qingqing.bean.Day;
import cool.qingqing.service.UserService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author 高山青
 * @Date 2021/12/30  -   15:25
 */
public class SpringTest01 {



	@Test
	public void test() {
		ApplicationContext bean = new AnnotationConfigApplicationContext(Main.class);
		UserService userService = (UserService) bean.getBean("userService");
		userService.add();
	}

	@Test
	public void test01() {
		ApplicationContext bean = new AnnotationConfigApplicationContext(Main.class);
		Day day = (Day) bean.getBean("dayAll");
		Day day01 = (Day) bean.getBean("day");
		System.out.println(day);
		System.out.println(day);
		System.out.println(day01);
		System.out.println(day01);



	}
}
